import request from '@/utils/request'

// 分页查询数据
export const dishpage = (page, pageSize, name, categoryId, status) => {
  return request.get('/admin/dish/page', {
    params: {
      page: page,
      pageSize: pageSize,
      name: name,
      categoryId: categoryId,
      status: status
    }
  })
}

// 菜品套餐分类查询
export const dishCategory = (type) => {
  return request.get(`/admin/dish/${type}`)
}

// 添加菜品
export const addDish = (categoryId, description, flavors,
  imageUrl, name, price, status) => {
  return request.post('/admin/dish', {
    categoryId: categoryId,
    description: description,
    flavors: flavors,

    image: imageUrl,
    name: name,
    price: price,
    status: status
  })
}

// 删除所有员工
export const deleteAll = (ids) => {
  return request.delete('/admin/dish', {
    params: {
      ids: ids
    }
  })
}

// 启售禁售菜品
export const dishstatus = (status, id) => {
  return request.post(`/admin/dish/status/${status}`, id)
}

// 根据id回显菜品
export const getdish = (id) => {
  return request.get(`/admin/dish/query/${id}`)
}

//  修改菜品

export const updatedish = (editFrom) => {
  return request.put('/admin/dish/update', editFrom)
}
